package com.snailhd.factory;


import com.snailhd.common.db.SimpleRedisClient;

/**
 * @author hd
 * @description
 * @date 2019-08-19 11:08
 */
public class RedisFactory {

//    private final static String host = "127.0.0.1";
    private final static String host = "192.168.0.179";
    private final static int port = 6379;
    private final static String pwd = "123456";
    private final static int database =11;
    private final static int maxIdle = 30;
    private final static int minIdle = 10;
    private final static int maxTotal = 50;

    private static SimpleRedisClient client;

    public static SimpleRedisClient getClient(){
        if(client==null){
            synchronized (SimpleRedisClient.class){
                if(client==null){
                    client = new SimpleRedisClient(host, port, pwd,database,maxIdle, minIdle, maxTotal);
                }
            }
        }
        return client;
    }

    public static void main(String[] args) {
        SimpleRedisClient client = RedisFactory.getClient();
        client.get("ss");
    }
}



